<!DOCTYPE html>
<html lang="en">
  <head>
    <title>File Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>

    <a name="//apple_ref/swift/Class/File" class="dashAnchor"></a>

    <a title="File Class Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          PerfectLib Docs
        </a>
         (70% documented)
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/PerfectlySoft/Perfect">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">PerfectLib Reference</a>
      <img class="carat" src="../img/carat.png" />
      File Class Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Bytes.html">Bytes</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/File.html">File</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/File/OpenMode.html">– OpenMode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/HTTP2Client.html">HTTP2Client</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/HTTPServer.html">HTTPServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/JSONConvertibleObject.html">JSONConvertibleObject</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/JSONDecoding.html">JSONDecoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MimeReader.html">MimeReader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MimeReader/BodySpec.html">– BodySpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheEvaluationContext.html">MustacheEvaluationContext</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheEvaluationOutputCollector.html">MustacheEvaluationOutputCollector</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheGroupTag.html">MustacheGroupTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheParser.html">MustacheParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustachePartialTag.html">MustachePartialTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustachePragmaTag.html">MustachePragmaTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheTag.html">MustacheTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/MustacheTemplate.html">MustacheTemplate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/SysProcess.html">SysProcess</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/TemporaryFile.html">TemporaryFile</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Global Variables.html">Global Variables</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Global Variables.html#/s:v10PerfectLib10fileStderrCS_4File">fileStderr</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Global Variables.html#/s:v10PerfectLib9fileStdinCS_4File">fileStdin</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Global Variables.html#/s:v10PerfectLib10fileStdoutCS_4File">fileStdout</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Global Variables.html#/s:v10PerfectLib22serverPerfectLibrariesSS">serverPerfectLibraries</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enums</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPFilterPriority.html">HTTPFilterPriority</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPMethod.html">HTTPMethod</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPRequestFilterResult.html">HTTPRequestFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPRequestHeader.html">HTTPRequestHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPRequestHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPResponseFilterResult.html">HTTPResponseFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPResponseHeader.html">HTTPResponseHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPResponseHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPResponseStatus.html">HTTPResponseStatus</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/JSONConversionError.html">JSONConversionError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/MustacheError.html">MustacheError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/PerfectError.html">PerfectError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Array.html">Array</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Bool.html">Bool</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Dictionary.html">Dictionary</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Int.html">Int</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/NetNamedPipe.html">NetNamedPipe</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/Optional.html">Optional</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UInt.html">UInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/UnicodeScalar.html">UnicodeScalar</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_17HTTPRequestHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_18HTTPResponseHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:ZF10PerfectLiboi2eeFTOS_10HTTPMethodS0__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib10empty_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">empty_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib10formatDateFzTSd6formatSS8timezoneGSqSS_6localeGSqSS__SS">formatDate(_:format:timezone:locale:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib6getNowFT_Sd">getNow()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib16icuDateToSecondsFSdSi">icuDateToSeconds(_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib15mustacheRequestFT7requestPS_11HTTPRequest_8responsePS_12HTTPResponse_7handlerPS_19MustachePageHandler_12templatePathSS_T_">mustacheRequest(request:response:handler:templatePath:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib11random_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">random_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Functions.html#/s:F10PerfectLib16secondsToICUDateFSiSd">secondsToICUDate(_:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/HTTPRequest.html">HTTPRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/HTTPRequestFilter.html">HTTPRequestFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/HTTPResponse.html">HTTPResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/HTTPResponseFilter.html">HTTPResponseFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/HeaderListener.html">HeaderListener</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/JSONConvertible.html">JSONConvertible</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/MustachePageHandler.html">MustachePageHandler</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structs</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Dir.html">Dir</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Encoding.html">Encoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/GenerateFromPointer.html">GenerateFromPointer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/HTTPCookie.html">HTTPCookie</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/HTTPCookie/Expiration.html">– Expiration</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/JSONConvertibleNull.html">JSONConvertibleNull</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs.html#/s:V10PerfectLib3Log">Log</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MimeType.html">MimeType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MimeType/TopType.html">– TopType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/PerfectServer.html">PerfectServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/RouteMap.html">RouteMap</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Routing.html">Routing</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/StaticFileHandler.html">StaticFileHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/UTF8Encoding.html">UTF8Encoding</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>File</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">File</span></code></pre>

                </div>
              </div>
            <p>Provides access to a file on the local file system</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File6existsSb"></a>
                    <a name="//apple_ref/swift/Property/exists" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File6existsSb">exists</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Checks that the file exists on the file system
- returns: True if the file exists or false otherwise</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">exists</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>True if the file exists or false otherwise</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File6isOpenSb"></a>
                    <a name="//apple_ref/swift/Property/isOpen" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File6isOpenSb">isOpen</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns true if the file has been opened</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isOpen</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File4pathSS"></a>
                    <a name="//apple_ref/swift/Property/path" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File4pathSS">path</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the file&rsquo;s path</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">path</span><span class="p">:</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File8realPathSS"></a>
                    <a name="//apple_ref/swift/Property/realPath" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File8realPathSS">realPath</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the file path. If the file is a symbolic link, the link will be resolved.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">realPath</span><span class="p">:</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File16modificationTimeSi"></a>
                    <a name="//apple_ref/swift/Property/modificationTime" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File16modificationTimeSi">modificationTime</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the modification date for the file in the standard UNIX format of seconds since 1970/01/01 00:00:00 GMT
- returns: The date as Int</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">modificationTime</span><span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The date as Int</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4FilecFTSS2fdVs5Int32_S0_"></a>
                    <a name="//apple_ref/swift/Method/init(_:fd:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4FilecFTSS2fdVs5Int32_S0_">init(_:fd:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a file object given a path and open mode
- parameter path: Path to the file which will be accessed
   - parameter fd: The file descriptor, if any, for an already opened file</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">fd</span><span class="p">:</span> <span class="kt">Int32</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>path</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Path to the file which will be accessed</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>fd</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The file descriptor, if any, for an already opened file</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File5closeFT_T_"></a>
                    <a name="//apple_ref/swift/Method/close()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File5closeFT_T_">close()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Closes the file if it had been opened</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">close</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File7abandonFT_T_"></a>
                    <a name="//apple_ref/swift/Method/abandon()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File7abandonFT_T_">abandon()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Resets the internal file descriptor, leaving the file opened if it had been.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">abandon</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:OC10PerfectLib4File8OpenMode"></a>
                    <a name="//apple_ref/swift/Enum/OpenMode" class="dashAnchor"></a>
                    <a class="token" href="#/s:OC10PerfectLib4File8OpenMode">OpenMode</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The open mode for the file.</p>

                        <a href="../Classes/File/OpenMode.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">OpenMode</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File4openFzTOS0_8OpenMode_T_"></a>
                    <a name="//apple_ref/swift/Method/open(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File4openFzTOS0_8OpenMode_T_">open(_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file using the given mode.
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">open</span><span class="p">(</span><span class="n">_</span> <span class="nv">mode</span><span class="p">:</span> <span class="kt"><a href="../Classes/File/OpenMode.html">OpenMode</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">read</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File6markerSi"></a>
                    <a name="//apple_ref/swift/Property/marker" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File6markerSi">marker</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The current file read/write position.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">marker</span><span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File6deleteFT_T_"></a>
                    <a name="//apple_ref/swift/Method/delete()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File6deleteFT_T_">delete()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Closes and deletes the file</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">delete</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File6moveToFzT4pathSS9overWriteSb_S0_"></a>
                    <a name="//apple_ref/swift/Method/moveTo(path:overWrite:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File6moveToFzT4pathSS9overWriteSb_S0_">moveTo(path:overWrite:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Moves the file to the new location, optionally overwriting any existing file
- parameter path: The path to move the file to
- parameter overWrite: Indicates that any existing file at the destination path should first be deleted
- returns: Returns a new file object representing the new location
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">moveTo</span><span class="p">(</span><span class="nv">path</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">overWrite</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">File</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>path</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The path to move the file to</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>overWrite</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Indicates that any existing file at the destination path should first be deleted</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Returns a new file object representing the new location</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File6copyToFzT4pathSS9overWriteSb_S0_"></a>
                    <a name="//apple_ref/swift/Method/copyTo(path:overWrite:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File6copyToFzT4pathSS9overWriteSb_S0_">copyTo(path:overWrite:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Copies the file to the new location, optionally overwriting any existing file
- parameter path: The path to copy the file to
- parameter overWrite: Indicates that any existing file at the destination path should first be deleted
- returns: Returns a new file object representing the new location
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">copyTo</span><span class="p">(</span><span class="n"><a href="../Classes/File.html#/s:vC10PerfectLib4File4pathSS">path</a></span> <span class="nv">pth</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">overWrite</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">false</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">File</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>path</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The path to copy the file to</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>overWrite</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Indicates that any existing file at the destination path should first be deleted</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Returns a new file object representing the new location</p>

                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File4sizeSi"></a>
                    <a name="//apple_ref/swift/Property/size" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File4sizeSi">size</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the size of the file in bytes</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">size</span><span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File6isLinkSb"></a>
                    <a name="//apple_ref/swift/Property/isLink" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File6isLinkSb">isLink</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns true if the file is a symbolic link</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isLink</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File5isDirSb"></a>
                    <a name="//apple_ref/swift/Property/isDir" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File5isDirSb">isDir</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns true if the file is actually a directory</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isDir</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:vC10PerfectLib4File5permsSi"></a>
                    <a name="//apple_ref/swift/Property/perms" class="dashAnchor"></a>
                    <a class="token" href="#/s:vC10PerfectLib4File5permsSi">perms</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the UNIX style permissions for the file</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">perms</span><span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File13readSomeBytesFzT5countSi_GSaVs5UInt8_"></a>
                    <a name="//apple_ref/swift/Method/readSomeBytes(count:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File13readSomeBytesFzT5countSi_GSaVs5UInt8_">readSomeBytes(count:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Reads up to the indicated number of bytes from the file
- parameter count: The maximum number of bytes to read
- returns: The bytes read as an array of UInt8. May have a count of zero.
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">readSomeBytes</span><span class="p">(</span><span class="nv">count</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">]</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>count</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The maximum number of bytes to read</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The bytes read as an array of UInt8. May have a count of zero.</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File10readStringFzT_SS"></a>
                    <a name="//apple_ref/swift/Method/readString()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File10readStringFzT_SS">readString()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Reads the entire file as a string</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">readString</span><span class="p">()</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File5writeFzT6stringSS_Si"></a>
                    <a name="//apple_ref/swift/Method/write(string:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File5writeFzT6stringSS_Si">write(string:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Writes the string to the file using UTF-8 encoding
- parameter s: The string to write
- returns: Returns the number of bytes which were written
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="nv">string</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>s</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The string to write</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Returns the number of bytes which were written</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File5writeFzT5bytesGSaVs5UInt8_12dataPositionSi6lengthSi_Si"></a>
                    <a name="//apple_ref/swift/Method/write(bytes:dataPosition:length:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File5writeFzT5bytesGSaVs5UInt8_12dataPositionSi6lengthSi_Si">write(bytes:dataPosition:length:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Write the indicated bytes to the file
- parameter bytes: The array of UInt8 to write.
- parameter dataPosition: The offset within <code>bytes</code> at which to begin writing.
- parameter length: The number of bytes to write.
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">write</span><span class="p">(</span><span class="nv">bytes</span><span class="p">:</span> <span class="p">[</span><span class="kt">UInt8</span><span class="p">],</span> <span class="nv">dataPosition</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">length</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="kt">Int</span><span class="o">.</span><span class="n">max</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>bytes</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The array of UInt8 to write.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>dataPosition</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The offset within <code>bytes</code> at which to begin writing.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>length</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bytes to write.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File4lockFzT9byteCountSi_T_"></a>
                    <a name="//apple_ref/swift/Method/lock(byteCount:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File4lockFzT9byteCountSi_T_">lock(byteCount:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Attempts to place an advisory lock starting from the current position marker up to the indicated byte count. This function will block the current thread until the lock can be performed.
- parameter byteCount: The number of bytes to lock
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">lock</span><span class="p">(</span><span class="nv">byteCount</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>byteCount</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bytes to lock</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File6unlockFzT9byteCountSi_T_"></a>
                    <a name="//apple_ref/swift/Method/unlock(byteCount:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File6unlockFzT9byteCountSi_T_">unlock(byteCount:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unlocks the number of bytes starting from the current position marker up to the indicated byte count.
- parameter byteCount: The number of bytes to unlock
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unlock</span><span class="p">(</span><span class="nv">byteCount</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>byteCount</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bytes to unlock</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File7tryLockFzT9byteCountSi_T_"></a>
                    <a name="//apple_ref/swift/Method/tryLock(byteCount:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File7tryLockFzT9byteCountSi_T_">tryLock(byteCount:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Attempts to place an advisory lock starting from the current position marker up to the indicated byte count. This function will throw an exception if the file is already locked, but will not block the current thread.
- parameter byteCount: The number of bytes to lock
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">tryLock</span><span class="p">(</span><span class="nv">byteCount</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>byteCount</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bytes to lock</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC10PerfectLib4File8testLockFzT9byteCountSi_Sb"></a>
                    <a name="//apple_ref/swift/Method/testLock(byteCount:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC10PerfectLib4File8testLockFzT9byteCountSi_Sb">testLock(byteCount:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Tests if the indicated bytes are locked
- parameter byteCount: The number of bytes to test
- returns: True if the file is locked
- throws: <code>PerfectError.FileError</code></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">testLock</span><span class="p">(</span><span class="nv">byteCount</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>byteCount</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bytes to test</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>True if the file is locked</p>

                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>© 2016 PerfectlySoft Inc. and the Perfect project authors</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
